home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_bas
/
qbsvga.zip
/
SIM.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-04-22
|
3KB
|
91 lines
'
' This is a simple routine that may aid in seeing how to use the QBSVGA
' routines and where to put REGTYPE.INC. If you go to compile and link
' it, use QB.LIB (in addition to whatever other libraries you would
' normally use). This applies anytime you use the QBSVGA routines.
' Similarly, if you're going to use these routines from within the QB
' IDE, run QB with the "/L" command-line option.
'
' Put the contents of REGTYPE.INC here.
'
CALL BSCREEN(15!,7!,1!,1!,INREGS,OUTREGS)
CALL BLINE(10!,10!,790!,590!,14!,"BF",INREGS,OUTREGS)
CALL BCIRCLE(400!,300!,290!,13!,0!,0!,1!,INREGS,OUTREGS)
CALL BCIRCLE(400!,300!,150!,12!,0!,1.57!,1!,INREGS,OUTREGS)
S=3.141593
E=3*3.141593/2
CALL BCIRCLE(400!,300!,150!,11!,S,E,1!,INREGS,OUTREGS)
CALL BLINE(30!,30!,30!,350!,15!,"L",INREGS,OUTREGS)
CALL BCOLOR(12!)
'
' A negative number input to any of the QBSVGA routines for the color
' will be reset to the default color defined in the call to BSCREEN
' (or COLOR). (An exception to this is BVIEW; it uses color 0 in this
' situation.)
'
CALL BLINE(0!,0!,799!,599!,-1!,"L",INREGS,OUTREGS)
CALL BCOLOR(9!)
CALL BLOCATE(30!,10!,INREGS,OUTREGS)
CALL BPRINT("This is an example.",INREGS,OUTREGS)
PCOLOR=BPOINT(799!,599!,INREGS,OUTREGS)
CALL BLOCATE(3!,3!,INREGS,OUTREGS)
A$="Color of pixel at (800,600) is "+LTRIM$(RTRIM$(STR$(PCOLOR)))+";"
CALL BPRINT(A$,INREGS,OUTREGS)
CALL BPRINT(" (Wait...)",INREGS,OUTREGS)
RX=799
RY=599
CALL BLINE(0!,0!,RX,RY,10!,"B",INREGS,OUTREGS)
SLEEP 5
CALL BSCREEN(14!,6!,1!,1!,INREGS,OUTREGS)
CALL BLOCATE(1!,3!,INREGS,OUTREGS)
CALL BPRINT("Now I am going to use a graphics viewport;",INREGS,OUTREGS)
CALL BPRINT(" in a different screen mode.",INREGS,OUTREGS)
CALL BPRINT(" ",INREGS,OUTREGS)
CALL BPRINT("(Wait...)",INREGS,OUTREGS)
CALL BVIEW(40!,60!,230!,250!,0!,7!,INREGS,OUTREGS)
CALL BCIRCLE(100!,120!,40!,7!,0!,0!,2!,INREGS,OUTREGS)
'
' Paint inside of circle.
'
CALL BPAINT(100!,120!,11!,-1!,INREGS,OUTREGS)
'
' Paint top, bottom, and righthand portions of exterior of circle.
'
CALL BPAINT(141!,120!,13!,-1!,INREGS,OUTREGS)
'
' Paint remaining portion of circle exterior.
'
CALL BPAINT(59!,120!,13!,-1!,INREGS,OUTREGS)
SLEEP 5
CALL BCLS(0!,INREGS,OUTREGS)
CALL BLOCATE(1!,10!,INREGS,OUTREGS)
A$="Now I'm going to try to print 256 colors in that last graphics mode."
CALL BPRINT(A$,INREGS,OUTREGS)
CALL BLOCATE(3!,1!,INREGS,OUTREGS)
C=0
FOR I=33 TO 126
CALL BCOLOR(C)
CALL BPRINT(CHR$(I)+";",INREGS,OUTREGS)
C=C+1
NEXT I
FOR I=33 TO 126
CALL BCOLOR(C)
CALL BPRINT(CHR$(I)+";",INREGS,OUTREGS)
C=C+1
NEXT I
FOR I=33 TO 100
CALL BCOLOR(C)
CALL BPRINT(CHR$(I)+";",INREGS,OUTREGS)
C=C+1
NEXT I
CALL BPRINT(" ",INREGS,OUTREGS)
CALL BCOLOR(7!)
CALL BPRINT(" ",INREGS,OUTREGS)
CALL BPRINT(" ",INREGS,OUTREGS)
CALL BPRINT("Press a key to quit.",INREGS,OUTREGS)
270 IF INKEY$="" THEN GOTO 270
CALL BSCREEN(0!,7!,1!,1!,INREGS,OUTREGS)
END
'
' Put the contents of QBSVGA.BAS here.